package cn.tk.model.entity.mr;

import cn.tk.model.entity.AbstractEntity;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Objects;

/**
 * Created by denglw on 2021/7/14.<br/>
 * Desc: 意图
 */
@Data @NoArgsConstructor
@Entity(name = "mrIntent")
@Table(name = "mr_intent")
public class Intent extends AbstractEntity {

    /**
     * 编码
     */
    private String code;

    /**
     * 名称
     */
    private String name;

    /**
     * 类型：1系统意图，2场景意图
     */
    private Integer type;

    /**
     * 等级：1一级意图，2二级意图
     */
    private Integer level;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Intent)) {
            return false;
        }
        Intent intent = (Intent) o;
        return Objects.equals(intent.getId(), getId())
                && Objects.equals(code, intent.code)
                && Objects.equals(name, intent.name)
                && Objects.equals(type, intent.type)
                && Objects.equals(level, intent.level);
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), code, name, type, level);
    }
}
